Field of the Invention
The present invention relates to an image processing apparatus and an image capturing apparatus.
Description of the Related Art
There has been proposed a technique for acquiring or calculating a captured image and a depth map representing a distribution of depth information from the captured image. A three-dimensional image is generated by using the depth map. However, because the acquired depth information often contains an error, there has been proposed a technique for correcting depth information of each pixel in the depth map. In Japanese Patent Laid-Open No. 2012-78942, clustering is performed by using pixel values and depth values of a plurality of pixels in a calculation range of a correction target pixel, a depth value of the correction target pixel is calculated on the basis of the clustering result, and thus depth information of each pixel is corrected. In addition, in Haruka Takenaka and four other authors, “Bilateral Filtering based depth image correction consistent with color image captured by Kinect”, Technical Report of IEICE, vol. 112, no. 385, PRMU2012-119, pp. 311-316, January 2013, a weight representing an index of the possibility of having a similar depth is decided upon by using a distance between a correction target pixel and its surrounding pixel, a distance between a pixel value of the correction target pixel and a pixel value of the surrounding pixel, and information on reliability of calculated depth information, and a weighted smoothing process is performed so as to correct depth information.
In Japanese Patent Laid-Open No. 2012-78942, and in Haruka Takenaka and four other authors, “Bilateral Filtering based depth image correction consistent with color image captured by Kinect”, Technical Report of IEICE, vol. 112, no. 385, PRMU2012-119, pp. 311-316, January 2013, depth information of a target pixel is corrected by using depth information or the like of pixels surrounding the target pixel. In order to accurately correct depth information, correction using a wide range of surrounding pixels is required, thereby increasing the amount of calculation.